package sweep;

import java.awt.*;
import javax.swing.*;
import java.net.*;

public class Sweep {
    public static final int FRAME_WIDTH = 600;
    public static final int FRAME_HEIGHT = 420;
    private static Game_tmp GameWindow;
    private static Menu MenuWindow;
    private static Login LoginWindow;
    private static Join JoinWindow;
    private static Start StartWindow;
    private static Wait WaitWindow;
    public static void startGameBoard(Socket client, String rival) {
        EventQueue.invokeLater(() -> {
            GameWindow = new Game_tmp(client, rival);
            GameWindow.setTitle("SweepGame");
            GameWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            GameWindow.setLocationByPlatform(true);
            GameWindow.setSize(640, 480);
            GameWindow.setResizable(false);
            GameWindow.setVisible(true);
        });
    }
    public static void startMenuBoard(Socket client) {
        EventQueue.invokeLater(() -> {
            MenuWindow = new Menu(client);
            MenuWindow.setTitle("SweepMenu");
            MenuWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            MenuWindow.setLocationByPlatform(true);
            MenuWindow.setSize(310, 160);
            MenuWindow.setResizable(false);
            MenuWindow.setVisible(true);
        });
    }
    public static void startLoginBoard(Socket server) {
        EventQueue.invokeLater(() -> {
            LoginWindow = new Login(server);
            LoginWindow.setTitle("SweepLogin");
            LoginWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            LoginWindow.setLocationByPlatform(true);
            LoginWindow.setSize(310, 140);
            LoginWindow.setResizable(false);
            LoginWindow.setVisible(true);
        });
    }
    public static void startJoinBoard(Socket server, String rival, String name) {
        EventQueue.invokeLater(() -> {
            JoinWindow = new Join(server, rival, name);
            JoinWindow.setTitle("SweepJoin");
            JoinWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JoinWindow.setLocationByPlatform(true);
            JoinWindow.setSize(310, 300);
            JoinWindow.setResizable(false);
            JoinWindow.setVisible(true);
        });
    }
    public static void startStartBoard(Socket server, String rival) {
        EventQueue.invokeLater(() -> {
            StartWindow = new Start(server, rival);
            StartWindow.setTitle("SweepJoin");
            StartWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            StartWindow.setLocationByPlatform(true);
            StartWindow.setSize(310, 300);
            StartWindow.setResizable(false);
            StartWindow.setVisible(true);
        });
    }
    public static void startWaitBoard(Socket server, String rival) {
        EventQueue.invokeLater(() -> {
            WaitWindow = new Wait(server, rival);
            WaitWindow.setTitle("SweepJoin");
            WaitWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            WaitWindow.setLocationByPlatform(true);
            WaitWindow.setSize(310, 300);
            WaitWindow.setResizable(false);
            WaitWindow.setVisible(true);
        });
    }
}

